package com.zhaoqi.hr.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 阿里云OSS配置
 */
@Configuration
public class OssConfig {

    @Value("${oss.access-key-id:LTAI5tG6chRmzwe3uKLrXdmA}")
    private String accessKeyId;

    @Value("${oss.access-key-secret:8v3FNE84HMmCNS8kYX3pXjBzgp5fes}")
    private String accessKeySecret;

    @Value("${oss.endpoint:oss-cn-hangzhou.aliyuncs.com}")
    private String endpoint;

    @Value("${oss.bucket-name:zhaoqi-zp}")
    private String bucketName;

    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
    }

    public String getAccessKeyId() {
        return accessKeyId;
    }

    public String getAccessKeySecret() {
        return accessKeySecret;
    }

    public String getBucketName() {
        return bucketName;
    }

    public String getEndpoint() {
        return endpoint;
    }
}
